﻿<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2"
    namespace="AcademicPlanner.Data.Entities" assembly="AcademicPlanner.Data">

	<class name="AccountEntity" table="accounts">
		<id name="Id" type="Int32" column="id" unsaved-value="0">
			<generator class="identity"/>
		</id>

		<property name="Activated" not-null="true" />
		<property name="Date_Activated" />
		<property name="Date_Inactivated" />
		<property name="Date_Added" not-null="true" />
		<property name="Trashed" not-null="true" />

		<many-to-one name="UserEntity" class="UserEntity" column="user_id" unique="true" not-null="true" />
	</class>

	<query name="AccountEntity.by.user.username">
		<![CDATA[
		from AccountEntity as a
		where a.UserEntity.Name = :username
		]]>
	</query>

</hibernate-mapping>
